package me.znext.learn.android;

import java.util.HashMap;

class Storage {
  private static Storage storage = new Storage();

  static Storage getStorage() {
    return storage;
  }

  private Storage() {
  }

  private HashMap<String, String> profile = new HashMap<>();

  void initProfile(HashMap<String, String> profile) {
    this.profile = profile;
  }

  void updateProfile (String field, String value) {
    profile.put(field, value);
    initProfile(profile);
  }

  HashMap<String, String> getProfile() {
    return profile;
  }

  String getProfile(String field) {
    return profile.get(field);
  }

}
